<!--
 * @Author: linZeJian
 * @Date: 2022-08-24 10:53:55
 * @LastEditors: linZeJian
 * @LastEditTime: 2022-09-01 11:03:29
 * @Description:
-->
<template>

  <van-field
      :modelValue="value"
          :label="column.label"
          :rows="column.minRows || 2"
          :maxlength="column.maxlength"
          :show-word-limit="column.showWordLimit"
          :readonly="column.readonly"
          :required="column.required"
          :disabled="column.disabled"
            @blur="onBlur"
          @focus="onFocus"
          :name="column.prop"
          :style="column.detail ? 'pointer-events: none;' : ''"
          :rules="[{ required: column.required }]"
          placeholder="请输入"

  />


</template>

<script>
  import mixEvent from './mixins/mixEvent';
export default {
  name: "avant-input",
  props: ['column','value'],
  inject: ['getViewFormData'],
  mixins: [mixEvent],
  data() {
    return {
      inputType: "",
    };
  },
  mounted(){
    if( this.getViewFormData){
      this.formData = this.getViewFormData()
    }
  },
  created() {},
  methods: {
    onBlur(){
      this.bindCalculatorEvent(this.column,this.value);
    },
    onFocus(){
      this.bindCalculatorEvent(this.column,this.value);
    },
    getType() {
      switch (this.column.type) {
        case "password":
          return "password";
        // 多行文本
        case "textarea":
          return "textarea";
      }
      return "text";
    },
  },
};
</script>

<style></style>
